﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using Summer.Windows.Support;
using Summer.Windows;
using WindowsIocDemo.Services;
namespace WindowsIocDemo
{
    public partial class Form1 : Form
    {
        private RandomNumberMakerService m_randomService;
        public Form1()
        {
            InitializeComponent();
            this.m_randomService = (RandomNumberMakerService)this.GetDefaultContextObject("random");
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            Get();
        }
        private void Get()
        {
            if (this.m_randomService != null) { label1.Text = this.m_randomService.Make(); }
        }
        private void button1_Click(object sender, EventArgs e)
        {
            Get();
        }
    }
}
